import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:hockey/extensions/jzx_json_extension.dart';
part 'jzx_follow_block_data.freezed.dart';
part 'jzx_follow_block_data.g.dart';

@freezed
class JzxBlockData with _$JzxBlockData {
  const factory JzxBlockData({
    // block
    @JzxJsonAlwaysString() @Default('') String nickName,
    @JzxJsonAlwaysString() @Default('') String avatar,
    @JzxJsonAlwaysNum() @Default(0) num age,
    @JzxJsonAlwaysString() @Default('') String registerCountry,
    @JzxJsonAlwaysString() @Default('') String broadcasterId,
    @JzxJsonAlwaysNum() @Default(0) num gender,

    // follow
  }) = _JzxBlockData;

  factory JzxBlockData.fromJson(Map<String, Object?> json) =>
      _$JzxBlockDataFromJson(json);
}

@freezed
class JzxFollowData with _$JzxFollowData {
  const factory JzxFollowData({
    @JzxJsonAlwaysString() @Default('') String userId,
    @JzxJsonAlwaysNum() @Default(0) num userType,
    @JzxJsonAlwaysString() @Default('') String nickname,
    @JzxJsonAlwaysString() @Default('') String avatar,
    @JzxJsonAlwaysString() @Default('') String avatarUrl,
    @JzxJsonAlwaysNum() @Default(0) num gender,
    @JzxJsonAlwaysString() @Default('') String birthday,
    @JzxJsonAlwaysNum() @Default(0) num age,
    @JzxJsonAlwaysString() @Default('') String language,
    @JzxJsonAlwaysString() @Default('') String country,
    @JzxJsonAlwaysString() @Default('') String about,
    bool? isSpecialFollow,
    @JzxJsonAlwaysString() @Default('') String onlineStatus,
    @JzxJsonAlwaysNum() @Default(0) num level,
    @JzxJsonAlwaysNum() @Default(0) num grade,
    bool? isVip,
  }) = _JzxFollowData;

  factory JzxFollowData.fromJson(Map<String, Object?> json) =>
      _$JzxFollowDataFromJson(json);
}
